# find_package(Check REQUIRED)
include_directories(
  # ${CHECK_INCLUDE_DIRS}
  ../export_como
  ../external/include
  ../${CMAKE_BINARY_DIR}/lib
)

set(LIBS ${LIBS} pmalloc $<$<BOOL:${LIBRT_LIBRARIES}>:${LIBRT_LIBRARIES}>)
include_directories(. ../src)

if( APPLE )
  link_directories( "/opt/local/lib" )
endif( APPLE )


set(SOURCES
    test.cpp
    check_common.cpp
    check_dpramapi.cpp
    check_pmalloc.cpp
    check_pmclear.cpp
    check_pmrecycle.cpp
    check_pmsimulate.cpp
    )

add_executable(testPmalloc ${SOURCES})
target_link_libraries(testPmalloc ${LIBS} gtest gtest_main)

# 原项目在CTest下的测试用例代码
# add_executable(check_pmsimulate check_pmsimulate.cpp check_common.cpp)
# target_link_libraries(check_pmsimulate ${LIBS} gtest gtest_main)
# add_test(check_pmsimulate ${CMAKE_CURRENT_BINARY_DIR}/check_pmsimulate)

# add_executable(check_pmrecycle check_pmrecycle.cpp check_common.cpp)
# target_link_libraries(check_pmrecycle ${LIBS} gtest gtest_main)
# add_test(check_pmrecycle ${CMAKE_CURRENT_BINARY_DIR}/check_pmrecycle)

# add_executable(check_pmclear check_pmclear.cpp check_common.cpp)
# target_link_libraries(check_pmclear ${LIBS} gtest gtest_main)
# add_test(check_pmclear ${CMAKE_CURRENT_BINARY_DIR}/check_pmclear)

# add_executable(check_pmalloc check_pmalloc.cpp check_common.cpp)
# target_link_libraries(check_pmalloc ${LIBS} gtest gtest_main)
# add_test(check_pmalloc ${CMAKE_CURRENT_BINARY_DIR}/check_pmalloc)

# add_executable(check_dpramapi check_dpramapi.cpp check_common.cpp)
# target_link_libraries(check_dpramapi ${LIBS} gtest gtest_main)
# add_test(check_dpramapi ${CMAKE_CURRENT_BINARY_DIR}/check_dpramapi)
